<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
//require_once($_SERVER["DOCUMENT_ROOT"]."/include/funcs.php");
//$APPLICATION->SetTitle("");
//print_r($_REQUEST);
$arrpath=explode("/", $APPLICATION->GetCurDir());
//Echo $APPLICATION->GetCurDir();
if($arrpath["1"]=='catalog'):
$blockid = GetIdBlockByCode($arrpath["2"]);
$_SESSION['CompareCurBlock']=$blockid;
else:
$blockid=$_SESSION['CompareCurBlock'];
//echo $blockid;
endif;

if(!empty($_REQUEST["blockid"])) $blockid=$_REQUEST["blockid"];

//arrprint($_SESSION,'$_SESSION');
?> <?$APPLICATION->IncludeComponent("bitrix:catalog.compare.list", "compare", array(
	"IBLOCK_TYPE" => "catalog",
	"IBLOCK_ID" => $blockid,
	"AJAX_MODE" => "N",
	"AJAX_OPTION_JUMP" => "N",
	"AJAX_OPTION_STYLE" => "Y",
	"AJAX_OPTION_HISTORY" => "N",
	"DETAIL_URL" => "",
	"COMPARE_URL" => "/catalog/compare.php",
	"NAME" => "CATALOG_COMPARE_LIST",
	"AJAX_OPTION_ADDITIONAL" => ""
	),
	false
);
?>